<?php

require_once dirname(__FILE__).'/../lib/quincenaGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/quincenaGeneratorHelper.class.php';

/**
 * quincena actions.
 *
 * @package    control_obras
 * @subpackage quincena
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $
 */
class quincenaActions extends autoQuincenaActions
{
  public function executeVerPersonalQuincena(sfWebRequest $request)
  {
    $request->setParameter('quincena_id', $this->getRoute()->getObject()->getId());

    $this->forward('personal_quincena', 'verPersonalPorQuincena');
  }

  public function executeVerResumen(sfWebRequest $request)
  {
    $this->Quincena = $this->getRoute()->getObject();

    $this->Cargos = array();

    foreach (CargoPeer::doSelect(new Criteria()) as $cargo)
    {
      $c['cargo'] = $cargo;
      $c['total'] = $this->Quincena->getTotalByCargo($cargo);

      $this->Cargos[] = $c;
    }
  }
}
